Type traits defines an compile-time template-based interface to query or modify the properties of types.
Primary type categories
|
|
|
|
|
checks if a type is void (class template)
|
|
|
|
|
checks if a type is integral type (class template)
|
|
|
|
|
checks if a type is floating-point type (class template)
|
|
|
|
|
checks if a type is an array type (class template)
|
|
|
|
|
checks if a type is a pointer type (class template)
|
|
|
|
|
checks if a type is lvalue reference (class template)
|
|
|
|
|
checks if a type is rvalue reference (class template)
|
|
|
|
|
checks if a type is a pointer to a non-static member object (class template)
|
|
|
|
|
checks if a type is a pointer to a non-static member function (class template)
|
|
|
|
|
checks if a type is an enumeration type (class template)
|
|
|
|
|
checks if a type is an union type (class template)
|
|
|
|
|
checks if a type is a class type (but not union type) (class template)
|
|
|
|
|
checks if a type is a function type (class template)
|
Composite type categories
|
|
|
|
|
checks if a type is either lvalue reference or rvalue reference (class template)
|
|
|
|
|
checks if a type is arithmetic type (class template)
|
|
|
|
|
checks if a type is fundamental type (class template)
|
|
|
|
|
checks if a type is object type (class template)
|
|
|
|
|
checks if a type is scalar type (class template)
|
|
|
|
|
checks if a type is compound type (class template)
|
|
|
|
|
checks if a type is a pointer to a non-static member function or object (class template)
|
Type properties
|
|
|
|
|
checks if a type is const-qualified (class template)
|
|
|
|
|
checks if a type is volatile-qualified (class template)
|
|
|
|
|
checks if a type is trivial (class template)
|
|
|
|
|
checks if a type is trivially copyable (class template)
|
|
|
|
|
checks if a type is standard-layout type (class template)
|
|
|
|
|
checks if a type is plain-old data (POD) type (class template)
|
|
|
|
|
checks if a type is literal type (class template)
|
|
|
|
|
checks if a type is class (but not union) type and has no data (class template)
|
|
|
|
|
checks if a type is polymorphic class type (class template)
|
|
|
|
|
checks if a type is abstract class type (class template)
|
|
|
|
|
checks if a type is signed integer type (class template)
|
|
|
|
|
checks if a type is unsigned integer type (class template)
|
Supported operations
|
|
|
|
|
checks if a type has a constructor for specific arguments (class template)
|
|
|
|
|
checks if a type has a default constructor (class template)
|
|
|
|
|
checks if a type has a copy constructor (class template)
|
|
|
|
|
checks if a type has a move constructor (class template)
|
|
|
|
|
checks if a type has a assignment operator for a specific argument (class template)
|
|
|
|
|
checks if a type has a copy assignment operator (class template)
|
|
|
|
|
checks if a type has a move assignment operator (class template)
|
|
|
|
|
checks if a type has a non-deleted destructor (class template)
|
|
|
|
|
checks if a type has a virtual destructor (class template)
|
Type modification templates create new type definitions by applying modifications on a template parameter. The resulting type can then be accessed through type member typedef.
Const-volatility specifiers
|
|
|
|
|
removes const or/and volatile specifiers from the given type (class template)
|
|
|
|
|
adds const or/and volatile specifiers to the given type (class template)
|
References
|
|
|
|
|
removes reference from the given type (class template)
|
|
|
|
|
adds lvalue or rvalue reference to the given types (class template)
|
Pointers
|
|
|
|
|
removes pointer from the given type (class template)
|
|
|
|
|
adds pointer to the given type (class template)
|
Sign modifiers
|
|
|
|
|
makes the given integral type signed (class template)
|
|
|
|
|
makes the given integral type unsigned (class template)
|
Arrays
|
|
|
|
|
removes one extent from the given array type (class template)
|
|
|
|
|
removes all extents from the given array type (class template)
|
|
|
|
|
defines the type suitable for use as uninitialized storage for types of given size (class template)
|
|
|
|
|
defines the type suitable for use as uninitialized storage for all given types (class template)
|
|
|
|
|
applies type transformations as when passing a function argument by value (class template)
|
|
|
|
|
hides a function overload or template specialization based on compile-time boolean (class template)
|
|
|
|
|
chooses one type or another based on compile-type boolean (class template)
|
|
|
|
|
deduces the type all given types can implicitly convert to (class template)
|
|
|
|
|
obtains the underlying integer type for a given enumeration type (class template)
|
|
|
|
|
deduces the return type of a function call expresion (class template)
|